# Contributor: Drew DeVault <sir@cmpwn.com>
# Maintainer:
pkgname=liblouis
pkgver=3.22.0
pkgrel=0
pkgdesc="Braille translator and back-translator"
url="http://liblouis.org/"
arch="all"
license="GPL-3.0-or-later"
makedepends="help2man python3"
checkdepends="bash"
subpackages="$pkgname-static $pkgname-dev $pkgname-bin:_bin $pkgname-doc"
source="
	$pkgname-$pkgver.tar.gz::https://github.com/liblouis/liblouis/releases/download/v$pkgver/liblouis-$pkgver.tar.gz
	"

# secfixes:
#   3.22.0-r0:
#     - CVE-2022-26981

build() {
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--sysconfdir=/etc \
		--mandir=/usr/share/man \
		--localstatedir=/var \
		--enable-ucs4
	make
}

check() {
	make check
}

package() {
	make DESTDIR="$pkgdir" install
}

_bin() {
	mkdir -p "$subpkgdir"/usr
	mv "$pkgdir"/usr/bin "$subpkgdir"/usr
}

sha512sums="
0ad9466b001935b442732c18ddce973236fd7cd0629a1b7dcc6e4cd61c9fb0b8f78b0ca51a4fd94ca262e8b8687dcc6aed06967dd2cd1bea8b5b1a0c78e1f25f  liblouis-3.22.0.tar.gz
"
